import HeadFirst.hfpy_ch7_data.core.athletemodel as athletemodel
import HeadFirst.hfpy_ch7_data.core.yate as yate

import glob

data_files = glob.glob("data/*.txt")

athletes = athletemodel.put_to_store(data_files)

print(yate.start_response())
print(yate.include_header("Coach Kelly's List of Athletes"))
print(yate.start_form("generate_time_data.py"))
print(yate.para("Select an athlete from the list to work with"))

# dict 也可以遍历each_athlete实际为key
for each_athlete in athletes:
    print(yate.radio_button("which_athlete"), athletes[each_athlete].name)

print(yate.end_form("Select"))

print(yate.include_footer({"Home", "/index.html"}))
